﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:Ewav.ContextMenu;assembly=Ewav.ContextMenu.Menu">

	<!-- Ewav.ContextMenu Controls MainMenu -->
	<Style TargetType="local:MainMenu">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MainMenu">
					<Canvas x:Name="RootElement" Background="{TemplateBinding Background}">
						<Canvas.Resources>
							<Style x:Key="horizontalStyle" TargetType="local:Menu">
								<Setter Property="ItemsPanel">
									<Setter.Value>
										<ItemsPanelTemplate>
											<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"/>
										</ItemsPanelTemplate>
									</Setter.Value>
								</Setter>
							</Style>
						</Canvas.Resources>
						<local:Menu x:Name="ElementMenu" CloseWhenOutOfFocus="False" Style="{StaticResource horizontalStyle}" BorderThickness="0" LeftBorderThickness="0" LeftBrush="#00ffffff" Background="#00ffffff" />
					</Canvas>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- End MainMenu -->

	<!-- Ewav.ContextMenu Controls MainMenuItem -->
	<Style TargetType="local:MainMenuItem">
        <Setter Property="FontSize" Value="12" />
        <Setter Property="FontFamily" Value="Segoe UI"/> 
        <Setter Property="Background" Value="#00ffffff" />
		<Setter Property="HoverBorderBrush" Value="#2999ff" />
		<Setter Property="HoverBorderThickness" Value="1" />
		<Setter Property="HoverBrush">
			<Setter.Value>
				<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="#92cae6" Offset="0.0" />
					<GradientStop Color="#92cae6" Offset="1.0" />
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="Padding" Value="6 2 6 2" />
		<Setter Property="ShowChildMenuOnHover" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MainMenuItem">
					<Grid x:Name="RootElement" Background="{TemplateBinding Background}">
						<Grid.RowDefinitions>
							<RowDefinition />
						</Grid.RowDefinitions>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition />
						</Grid.ColumnDefinitions>
						<Rectangle x:Name="ElementHover" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" RadiusX="0" RadiusY="0" Visibility="Collapsed" Stroke="{TemplateBinding HoverBorderBrush}" StrokeThickness="{TemplateBinding HoverBorderThickness}" Fill="{TemplateBinding HoverBrush}" />
						<Image x:Name="ElementIcon" Grid.Column="0" Grid.Row="0" Margin="4 0 0 0" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
						<TextBlock x:Name="ElementText" Grid.Column="1" Grid.Row="0" Text="{TemplateBinding Text}" FontFamily="{TemplateBinding FontFamily}"
						   FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Left"
						   FontStyle="{TemplateBinding FontStyle}" Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding Padding}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- End MainMenuItem -->

	<!-- Ewav.ContextMenu Controls MenuDivider -->
	<Style TargetType="local:MenuDivider">
		<Setter Property="Background">
			<Setter.Value>
				<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
					<GradientStop Color="#a0a0b4" Offset="0.0" />
                    <GradientStop Color="#a0a0b4" Offset="1.0" />
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MenuDivider">
					<Grid x:Name="RootElement">
						<Rectangle Margin="38 4 6 4" Height="2" Fill="{TemplateBinding Background}" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- End MenuDivider -->

	<!-- Ewav.ContextMenu Controls Menu -->
	<Style TargetType="local:Menu">
		<Setter Property="Background">
			<Setter.Value>
				<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
					<GradientStop Color="#f8ffffff" Offset="0.0" />
                    <GradientStop Color="#f8ffffff" Offset="1.0" />
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="BorderBrush" Value="#f8a0a0a0" />
		<Setter Property="BorderThickness" Value="1" />
		<Setter Property="LeftBrush">
			<Setter.Value>
				<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
					<GradientStop Color="#f8f4f7fc" Offset="0.0" />
                    <GradientStop Color="#f8f4f7fc" Offset="1.0" />
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="LeftBorderBrush" Value="#f8a0a0b4" />
		<Setter Property="LeftBorderThickness" Value="1" />
		<Setter Property="CloseWhenOutOfFocus" Value="True" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:Menu">
					<Grid x:Name="RootElement">
						<Border Margin="0 0 2 2" CornerRadius="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
							<Border.Effect>
								<DropShadowEffect Opacity="0.6" />
							</Border.Effect>
						</Border>
						<Rectangle Margin="2 2 2 4" Width="30" VerticalAlignment="Stretch" Fill="{TemplateBinding LeftBrush}" HorizontalAlignment="Left" />
						<Rectangle Margin="32 2 2 4" Width="{TemplateBinding LeftBorderThickness}" VerticalAlignment="Stretch" Fill="{TemplateBinding LeftBorderBrush}" HorizontalAlignment="Left" />
						<ItemsPresenter Margin="0 0 2 2" />
						<Canvas x:Name="ElementChildren" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- End Menu -->

	<!-- Ewav.ContextMenu Controls MenuItem -->
	<Style TargetType="local:MenuItem">
		<Setter Property="FontSize" Value="12" />
        <Setter Property="FontFamily" Value="Segoe UI"/>
		<Setter Property="Padding" Value="2" />
		<Setter Property="HoverBorderBrush" Value="#96d9f9" />
		<Setter Property="HoverBorderThickness" Value="1" />
		<Setter Property="Background" Value="#00ffffff" />
		<Setter Property="HoverBrush">
			<Setter.Value>
				<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="#aabae4f6" Offset="0.0" />
					<GradientStop Color="#aabae4f6" Offset="1.0" />
				</LinearGradientBrush>
			</Setter.Value>
		</Setter>
		<Setter Property="ContentMargin" Value="8 5 8 5" />
		<Setter Property="CheckBoxVisibility" Value="Collapsed" />
		<Setter Property="IsChecked" Value="False" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:MenuItem">
					<Grid x:Name="RootElement" Background="#00ffffff">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="30" />
							<ColumnDefinition />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="30" />
						</Grid.ColumnDefinitions>
						<Rectangle x:Name="ElementHover" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" RadiusX="0" RadiusY="0" Visibility="Collapsed" Stroke="{TemplateBinding HoverBorderBrush}" StrokeThickness="{TemplateBinding HoverBorderThickness}" Fill="{TemplateBinding HoverBrush}" />
						<Image x:Name="ElementIcon" Grid.Column="0" Margin="4 0 0 0" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
						<CheckBox x:Name="ElementCheckBox" Grid.Column="0" Margin="4 0 0 0" IsChecked="{Binding IsChecked,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" Visibility="{TemplateBinding CheckBoxVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" />
						<TextBlock x:Name="ElementText" Grid.Column="1" Text="{TemplateBinding Text}" FontFamily="{TemplateBinding FontFamily}"
						   FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Left"
						   FontStyle="{TemplateBinding FontStyle}" Foreground="{TemplateBinding Foreground}" Padding="{TemplateBinding ContentMargin}" />
						<TextBlock x:Name="ElementShortcut" Grid.Column="2" Text="{TemplateBinding Shortcut}" FontFamily="{TemplateBinding FontFamily}"
						   FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Right" VerticalAlignment="Center"
						   FontStyle="{TemplateBinding FontStyle}" Foreground="{TemplateBinding Foreground}" />
						<Polygon x:Name="ElementChildren" Grid.Column="3" Points="0,0 3,3 0,6" Fill="#000000" HorizontalAlignment="Center" VerticalAlignment="Center" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<!-- End MenuItem -->
</ResourceDictionary>